<?php

namespace frontend\controllers;

use Yii;
use frontend\models\Catelog;
use frontend\models\Note;
use frontend\models\Subject;
use frontend\models\Post;
use frontend\models\Sltopic;
use frontend\models\Shicai;
use frontend\models\Zytopic;
use frontend\models\Zhongyao;
use yii\console\Controller;
use yii\filters\VerbFilter;

/**
 * CatelogController implements the CRUD actions for Catelog model.
 */
class SitemapController extends Controller {

    /**
     * @inheritdoc
     */
    public function behaviors() {
        return [
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['POST'],
                ],
            ],
        ];
    }

    public function actionIndex() {
        echo \Yii::$app->id;
        echo "\n";
    }

    public function actionCreate() {
//        var_dump(Catelog::className());
        \Yii::$app->sitemap
                ->addModel(Catelog::className())
                ->addModel(Subject::className())
                ->addModel(Sltopic::className())
                ->addModel(Zytopic::className())
                ->addModel(Shicai::className())
                ->addModel(Zhongyao::className())
                ->addModel(Note::className())
                ->addModel(Post::className())
                ->setDisallowUrls([
//                    '#url1#',
//                    '#url2$#',
                ])
                ->create();
    }

}
